package jjn.round1;

import commons.ListNode;

/**
 * @author Jjn
 * @since 2022-07-27 8:56
 */
public class LeetCode876_MiddleOfLinkedList {
    
    public ListNode middleNode(ListNode head) {
        ListNode fast = head;
        ListNode slow = head;
        while (slow != null && slow.next != null) {
            slow = slow.next.next;
            fast = fast.next;
        }
        return fast;
    }
}
